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

Query time 0.00022