UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6R/mn/IYecqByR3DBwEU5gVg1bHbtnfKh9NzDL0mJVw=' 
WHERE 
  key_id = '8b18140db4353db226095744b8fdb34f89006286d3f18ac6fe8649aabe9b1308' 
  AND (
    token = '6R/mn/IYecqByR3DBwEU5gVg1bHbtnfKh9NzDL0mJVw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017