UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GutaBwYgTdqzgnBmjC/QcCaDXPpOTUDbPVXWeNhgGRQ='
WHERE
key_id = 'da3b44054e990596d5d62427374e2a3cf29f246763bcec163dceca3275364149'
AND (
token = 'GutaBwYgTdqzgnBmjC/QcCaDXPpOTUDbPVXWeNhgGRQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)