UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tGUcXOyqgKrOe8nVVw8N85WYU7+B4Xk8wJRQKjzOaPk='
WHERE
key_id = 'c33e3c0c011dc94cc2e265732ce7756350278b82cc780289d14634f1b47445e3'
AND (
token = 'tGUcXOyqgKrOe8nVVw8N85WYU7+B4Xk8wJRQKjzOaPk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)