UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MbeQCnri8tsfjDZl2hDsGMVIk8yiQx3v9Ww7qYowWVM=' 
WHERE 
  key_id = 'b3bd413f70472b718694062e43102aefaf1199e5ae498987e1b787e161872fe5' 
  AND (
    token = 'MbeQCnri8tsfjDZl2hDsGMVIk8yiQx3v9Ww7qYowWVM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045