UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vuMug/HJfRxTzSBdO0iiqe4F5E7ApMD3UwqvnBnOqkQ=' 
WHERE 
  key_id = '2dd2603a4e6cf7a364639ebf5eb2a6a2b7c6c04f7cbafa665732ec44e9a2c49c' 
  AND (
    token = 'vuMug/HJfRxTzSBdO0iiqe4F5E7ApMD3UwqvnBnOqkQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056