UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'morqIIlPYHQnA7nSdZceoRrArWyj4TROsymXb3Ag5hI='
WHERE
key_id = '3c46263fd3c63b953b4762f51e802611c34fb54e4e52a5de2d97a3e14f279e23'
AND (
token = 'morqIIlPYHQnA7nSdZceoRrArWyj4TROsymXb3Ag5hI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)