UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PVB93zuB0DVDGkTAPPQTnQjUH/boPFvDCWcWl71/4fo=' 
WHERE 
  key_id = '1c9ef7292d196f48e8baf4a649a26c0e8ce64cf15f9fa1bc3d31dc1d76030183' 
  AND (
    token = 'PVB93zuB0DVDGkTAPPQTnQjUH/boPFvDCWcWl71/4fo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032