UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RzzD93KDtHTpR4Nuz9ZF2+sGCuP0K1GI4hHwAPlPixQ='
WHERE
key_id = 'ffea79c2c8475334a0b12c7adbacc5546865470579b9695a4ec3e546579c5b4a'
AND (
token = 'RzzD93KDtHTpR4Nuz9ZF2+sGCuP0K1GI4hHwAPlPixQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)