UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/NDf/Sk8xHX44ZK4EQfxjF0fvijEsAKfG5M2zbbpnUE='
WHERE
key_id = 'f14b9925842dca8de13c8b65081bb09e18af33c8a8895a14095e0f7241a1eedc'
AND (
token = '/NDf/Sk8xHX44ZK4EQfxjF0fvijEsAKfG5M2zbbpnUE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)