UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TI024PadS9jON2MTYJx9MyQTyjRQeqWvVfzXMTwZh4U=' 
WHERE 
  key_id = '049d6800bd72fa9748b3c735024f883e8881192c26fc38e7fe74727079026bbf' 
  AND (
    token = 'TI024PadS9jON2MTYJx9MyQTyjRQeqWvVfzXMTwZh4U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033