UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MDPIqmcMvRHx8iQOKff/GSWE4dqUQ7Q8IQ4twUJtXF0='
WHERE
key_id = '4441a0fa46a3524b3973544f2ebbc04d7ee18d9f1ff13b90b9f7f6716e9a514d'
AND (
token = 'MDPIqmcMvRHx8iQOKff/GSWE4dqUQ7Q8IQ4twUJtXF0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)