UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r8XAJC+1l8tGkzGJ9AINRM92vEW9NpVIWJaKG9tf+UE='
WHERE
key_id = '2dffb675777f5a5d556dc848f553cd8b8d1d3c79db0f34b4e8a5700436bcb4ae'
AND (
token = 'r8XAJC+1l8tGkzGJ9AINRM92vEW9NpVIWJaKG9tf+UE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)