UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l5HK8Cqvrp8yvPzgeyZS5HYQHY+PkGzL4gdg5sJhyzI=' 
WHERE 
  key_id = '12750ff28d58277cd9c92e8fab2bdd08351de34f08b965e1a61eba8985a5c1cf' 
  AND (
    token = 'l5HK8Cqvrp8yvPzgeyZS5HYQHY+PkGzL4gdg5sJhyzI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037