UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '215GzYZxO7j2RmxwhuBYTndYEfTAJ5qWHEmBBTLNVVk=' 
WHERE 
  key_id = '16936fa53ada26233dacacdf878914d3c53bfb4b701566d25c09b000ba98f1f9' 
  AND (
    token = '215GzYZxO7j2RmxwhuBYTndYEfTAJ5qWHEmBBTLNVVk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017