UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mHHquRPiTdr56UKiehCMva+pYhP48CQFZb5dSehd5xE='
WHERE
key_id = '562dd1005c827aa14351c71db2ffe8e6f9b2425bdc5f1c23a83d0a4a4e4c63af'
AND (
token = 'mHHquRPiTdr56UKiehCMva+pYhP48CQFZb5dSehd5xE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)