UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fPMa45xTkI/hrcjngqvh9fn/Z0xlpb/jORsFyiCg4HA=' 
WHERE 
  key_id = 'c1edb008552ecc035d25e94e10447db8fd5c6c10dd597101e898f3e7d99345d5' 
  AND (
    token = 'fPMa45xTkI/hrcjngqvh9fn/Z0xlpb/jORsFyiCg4HA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020