UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ynGk+nYSMC9NIB5zZ6cngrOIOCd3+Ln0iCSTK/FoBzc='
WHERE
key_id = '8e43f781f78ef202178671f829d0b0119f422c67de5ee7d842a4f693d63b3616'
AND (
token = 'ynGk+nYSMC9NIB5zZ6cngrOIOCd3+Ln0iCSTK/FoBzc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)