UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1XZYV9lVxurOoSjAHPC/KjlvEkRRb1tVR3nYVbRY5rA='
WHERE
key_id = '0468be2e85cd447af9fc11444fd0297aae5ea91009f71c6f78e75d635bf421fb'
AND (
token = '1XZYV9lVxurOoSjAHPC/KjlvEkRRb1tVR3nYVbRY5rA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)