UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1+O+PiVHYwC/eK0fy3fWlZ61KltKwPDR2GaARPlG7qQ='
WHERE
key_id = 'e39856794634246ded34b1a55a5a3c2daff1c58f515e9d9fca47bc03d320f5cf'
AND (
token = '1+O+PiVHYwC/eK0fy3fWlZ61KltKwPDR2GaARPlG7qQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)