UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0Rwgjrjsh84xMkL4lx0sg8CoZLoim6ayqmp5jGuvBH4=' 
WHERE 
  key_id = '992785c9a14b25added2532904c37fb50b4d8f932801b20759e59e4ed573d086' 
  AND (
    token = '0Rwgjrjsh84xMkL4lx0sg8CoZLoim6ayqmp5jGuvBH4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027