UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fp59ALk9XvBnxR9Xa85jPzHKMW/sPobKB4/qvyRn9ro='
WHERE
key_id = '67ac4ba6ad122e59fef1ff15a80a4bff63483988e17c93ca128c06bda8af58a9'
AND (
token = 'fp59ALk9XvBnxR9Xa85jPzHKMW/sPobKB4/qvyRn9ro='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)