UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w7jWBzmlj+nSIwduX/fyPr6gGxFhYHSQJSognSp11V8=' 
WHERE 
  key_id = 'fc4e8856b453b835a7f49188afe271a6b2158fc4afa22a67c904f1ba305ed88a' 
  AND (
    token = 'w7jWBzmlj+nSIwduX/fyPr6gGxFhYHSQJSognSp11V8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057