UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xlxbouqM5+/a/6hFukbLd4llZiV6cOvGTGosRPgkHIU=' 
WHERE 
  key_id = 'b3f5574411bb62858fe87efbd2fc2dc057ea4cf90901fd79723e1727da6f40a5' 
  AND (
    token = 'xlxbouqM5+/a/6hFukbLd4llZiV6cOvGTGosRPgkHIU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045