UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GOWYonM8ivkFAa9ljR/hhSAi5OSXhViA8rSnRrNAFZ4='
WHERE
key_id = '3a2edb39091d0a58dc82e7b43475ca7cdf1e04342b96b554789580abf643dba2'
AND (
token = 'GOWYonM8ivkFAa9ljR/hhSAi5OSXhViA8rSnRrNAFZ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)