UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iU6/Ek+nQSo7r1uraqn0j0pex9x+wZE8KkDpn5DhVNs='
WHERE
key_id = '14a95165148c72dec5d32e9158f54a7e82da09a762bee9e15f68a2ff75f4b2e3'
AND (
token = 'iU6/Ek+nQSo7r1uraqn0j0pex9x+wZE8KkDpn5DhVNs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)