UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oKmgz7BTHOdtk9i9ANrUw7iNR/4YOso+DrrYEi8oNM4=' 
WHERE 
  key_id = '6e71918bb4c6d5ab90ff1682a0a3dcfe9a42d8cf35c1005e081b1baefa2d56dc' 
  AND (
    token = 'oKmgz7BTHOdtk9i9ANrUw7iNR/4YOso+DrrYEi8oNM4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035