UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/k0FNOZl5XBUxCtRccBMBfXQf1Jper21P+rPNEf+fwM=' 
WHERE 
  key_id = '9f82ce189d339e225b56d2826bdd9f8c6e539607e898eade4cd5518f9abfe1e8' 
  AND (
    token = '/k0FNOZl5XBUxCtRccBMBfXQf1Jper21P+rPNEf+fwM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035