UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rnO0MypyFxu0il/HiK8RmIgB8oWL+f3X6XbEcQaLlsw='
WHERE
key_id = 'ffad9443322e1621020411995473d63bf0233459e0560aab8a617cc389322e3c'
AND (
token = 'rnO0MypyFxu0il/HiK8RmIgB8oWL+f3X6XbEcQaLlsw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)