UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ncxdeUE45eQhyLPIwVUj/PFVvwehzG/8ulGxmFhPiCs='
WHERE
key_id = '55830f00b5486ca1da6da117154fab19c78fb839fef4140b0b56d3b464857126'
AND (
token = 'ncxdeUE45eQhyLPIwVUj/PFVvwehzG/8ulGxmFhPiCs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)