UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '11r1yuw1+Kl29PFVhqdpoMKmw2YzFs5otwKHGDduARw='
WHERE
key_id = 'e2ff5625b55f5c85e32519e569d224eca604384942292999b4c3ed3dc305e681'
AND (
token = '11r1yuw1+Kl29PFVhqdpoMKmw2YzFs5otwKHGDduARw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)