UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't6IcI6bK8081pIWKZH6RB5gmdLYF11zY3w8J3uV2C2o=' 
WHERE 
  key_id = '16df1096b5f064a7bd91ca28c307429de3a264fabaedf0a67709f8ed3376173b' 
  AND (
    token = 't6IcI6bK8081pIWKZH6RB5gmdLYF11zY3w8J3uV2C2o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00315