UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wbQpMKx+QnhvF3OhfNUMLUyMEbCxfN3ydZ0ZUkKIloY='
WHERE
key_id = 'ee2c81662a7c12b1db22e8f2b3f59f1725da25f893211f0249fed3127e52df45'
AND (
token = 'wbQpMKx+QnhvF3OhfNUMLUyMEbCxfN3ydZ0ZUkKIloY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)