UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zF3aik4WepKHoiGJD7JN65W+NYQnWa/0OMeKyn4Qcks='
WHERE
key_id = 'f01273a0b4ec22e296c45dfef2f13ea2b8b4d8a278f35feca8608887628a748e'
AND (
token = 'zF3aik4WepKHoiGJD7JN65W+NYQnWa/0OMeKyn4Qcks='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)