UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rEVp25eXfI9fQhmF18RUI5iZMVltSOsC2xSTWxVaw/s='
WHERE
key_id = '6ca0f5bcf103403729ad67702ac0efb96245578099a14dd6a1723ab46eb5018c'
AND (
token = 'rEVp25eXfI9fQhmF18RUI5iZMVltSOsC2xSTWxVaw/s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)