UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L5VeHsygHI6qbF/tRrTYLCCXks80nNGbyWKNhE57ifs=' 
WHERE 
  key_id = '85b8432a95a86aee3fb243746ba216455d4f477004ea2758880ec9406458b38d' 
  AND (
    token = 'L5VeHsygHI6qbF/tRrTYLCCXks80nNGbyWKNhE57ifs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031