UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7sWk5W0MFvhqOfAFJP8r5ka0RGRqV8shayKXRwi4E7I=' 
WHERE 
  key_id = '7fe6cf2ff88657e7e38703b60afcfc22f9d77bbd4f7e192123a0a632b5c8adee' 
  AND (
    token = '7sWk5W0MFvhqOfAFJP8r5ka0RGRqV8shayKXRwi4E7I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030