UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hBn4rasHmQAsoakAlzdO+s9UBbyivaP4bdLbKrN2HH4='
WHERE
key_id = 'ce6ac98c007aeea0fdd79aff799e2b897a492a76bc3978cf1d875cbf7e3449b9'
AND (
token = 'hBn4rasHmQAsoakAlzdO+s9UBbyivaP4bdLbKrN2HH4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)